/*
 * NavCAction.cpp
 *
 *  Created on: May 27, 2012
 *      Author: kobe
 */

#include "NavCAction.h"

NavCAction::NavCAction() {

}

void NavCAction::add(AtomicAction* original, AtomicAction* complement) {
	ActionPair* pair = new ActionPair;
	pair->orig = new AtomicAction(original->toString());
	pair->complement = new AtomicAction(complement->toString());
	mList.push_back(pair);
}

AtomicAction* NavCAction::findOriginal(AtomicAction* c) {
	for (size_t i = 0; i < mList.size(); i ++) {
		if (mList[i]->complement->compare(c)) {
			return mList[i]->orig;
		}
	}
	return NULL;
}
AtomicAction* NavCAction::findComplement(AtomicAction* o) {
	for (size_t i = 0; i < mList.size(); i ++) {
		if (mList[i]->orig->compare(o)) {
			return mList[i]->complement;
		}
	}
	return NULL;
}

